<template>
  <v-container>
    <div>
      <v-container fluid>
        <v-btn @click="GetInfo">获取数据</v-btn>
        <v-data-table
          :headers="headers"
          :items="result"
          :items-per-page="3"
          class="elevation-1"
        ></v-data-table>
        
      </v-container>
    </div>
  </v-container>
</template>

<script>
import * as axios from "axios";
export default {
  
  name: 'file',
  data: () => ({
    result: [],
    headers: [
      { text: "用户名", value: "username" },
      { text: "密码", value: "password" },
      { text: "年龄", value: "age" },
      { text: "电话号码", value: "phoneNum" },
    ],
  }),
  methods: {
    GetInfo() {
      axios;
      axios
        .get("http://localhost:8888/getUserInfo", {
          params: {
            //NULL
          },
        })
        .then((response) => {
          this.result = response.data.msg;
        })
        .catch(function (error) {
          console.log(error);
        });
    },
  },
};
</script>
